package com.example.dynamic_form.controller;

import com.example.dynamic_form.domain.po.DynamicFormPo;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;
import com.example.dynamic_form.service.IDynamicFormService;


import java.util.List;

@RestController
@RequestMapping("dynamicForm")
public class DynamicFormController {

    @Resource
    private IDynamicFormService dynamicFormService;

    @GetMapping("listForm")
    public List<DynamicFormPo> listUser() {
        return dynamicFormService.list();
    }

    @PostMapping("createForm")
    public DynamicFormPo createForm(@RequestBody DynamicFormPo dynamicFormInfo) {
        dynamicFormService.save(dynamicFormInfo);
        return dynamicFormInfo;
    }
}
